<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ page import="java.util.Collection"%>
<%@ page contentType="text/html;charset=utf-8"%>
<link href="<%= request.getContextPath() + "/css/bloques.css" %>"
	rel="stylesheet" type="text/css">
<link href="<%= request.getContextPath() + "/css/table.css" %>"
	rel="stylesheet" type="text/css">
<script type="text/javascript"
	src="<%=request.getContextPath()%>/dwr/engine.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/dwr/interface/VisualHelper.js"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()%>/dwr/util.js"></script>
<script src="<%=request.getContextPath()%>/js/dateValidation.js"
	type="text/javascript"></script>
<script type="text/javascript"
	src="<%=request.getContextPath() + "/js/jquery-1.8.0.js"%>"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()
					+ "/js/jquery-ui-1.10.3.custom.min.js"%>"></script>
<script type="text/javascript"
	src="<%=request.getContextPath()
					+ "/js/jquery.ui.datepicker-es.js"%>"></script>
<link rel="stylesheet"
	href="<%=request.getContextPath()
					+ "/css/ui-lightness/jquery-ui-1.10.3.custom.css"%>" />
	
<script type="text/javascript">
$(document).ready(function() {
	$("#fechaNacimiento").change(function(){
		$("fecha").val($("#fechaNacimiento").val());
	});
	
});
</script>

<!-- DatePickers -->
<script type="text/javascript">
$.datepicker.setDefaults({
	  showOn: "button",
	  buttonImageOnly: true,
	  buttonImage: "<%=request.getContextPath() + "/images/Calendar.png"%>",
	  buttonText : "Calendario"
	});
	$(function() {
		$("#fechaNacimiento").datepicker({
			changeMonth : true,
			changeYear : true
		});
	});
</script>
	
<script type="text/javascript">   
   
function validar(){
	var fechaActual = new Date();
    var dd = fechaActual.getDate();
    var mm = fechaActual.getMonth()+1; // indice 0
    var yyyy = fechaActual.getFullYear();
    if(dd<10){dd='0'+dd;} if(mm<10){mm='0'+mm;} var fechaActual = dd+'/'+mm+'/'+yyyy;
    var fValida = isDate($("#fechaNacimiento").val());
	if(!fValida){
		alert('Fecha de nacimiento no valida.');
		return false;
	}else{
		if( $.datepicker.parseDate("dd/mm/yy", $("#fechaNacimiento").val()) > $.datepicker.parseDate("dd/mm/yy", fechaActual)){
			alert('La fecha de nacimiento no puede ser mayor que la fecha actual.');
			return false;
		}
	}
    
	if(document.guardarBeneficiario.numeroDocumento.value==""){
		alert("Debe introducir el numero de documento");
        document.guardarBeneficiario.numeroDocumento.focus();
        return;
	}
       
	if(document.guardarBeneficiario.primer_nombre.value==""){
		alert("Debe introducir el primer nombre");
		document.guardarBeneficiario.primer_nombre.focus();
		return;
	}
       
	if(document.guardarBeneficiario.primerApellido.value==""){
		alert("Debe introducir el primer apellido");
		document.guardarBeneficiario.primerApellido.focus();
		return;
	}
       
	if(document.guardarBeneficiario.vflComuna.value==""){
		alert("Debe introducir la comuna");
		document.guardarBeneficiario.vflComuna.focus();
		return;
	}

	if((document.guardarBeneficiario.ML.value=="true") && ((document.guardarBeneficiario.dirEncasillada.value=="") && (document.guardarBeneficiario.dirDescriptiva.value=="")) ){
		sw = 1;
		alert("Debe introducir la direccion encontrada en Matricula en linea en la forma Encasillada ");
		return;
	}
      
	field = document.guardarBeneficiario.dirDescriptiva; 
    if(document.guardarBeneficiario.dirDescriptiva.value != ""){
    	var valid = "ABCDEFGHIJKLMNÑOPQRSTUVWXYZabcdefghijklmnñopqrstuvwxyz 1234567890";
        var ok = "yes";
        var temp;
        for (var i=0; i<field.value.length; i++) {
        	temp = "" + field.value.substring(i, i+1);
        	if (valid.indexOf(temp) == "-1") ok = "no";
        }
	}
	if (ok == "no") {
    	alert("La direccion descriptiva solo permite letras (A - Z | a - z)");
        field.focus();
        field.select();
        return;
	}else document.guardarBeneficiario.submit();  
          
} 
    
function buscar(origen){
	VisualHelper.buscarPadre(dwr.util.getValue("barrios"),function(data) {
	var array = data.split("|"); 
    dwr.util.setValue("comunas",array[0]);
    dwr.util.setValue("zonas",array[1]);
    });
}
  
function LimpiarEnc(){
	$("#dirDescriptiva").prop('disabled', false);
	$("#dirEncasillada").val("");
	$("#viaTipo").val("");
	$("#vNro").val("");
	$("#viaOrientacion").val("");
	$("#viaApendice").val("");
	$("#cruceOrientacion").val("");
	$("#cruceNumero").val("");
	$("#cruceApendice").val("");
	$("#placa").val("");
	$("#interior").val("");
	$("#bloque").val("");
    tipo='';
    vNro='';
    vOr='';
    vApn='';
    cOr='';
    cNro='';
    cApn='';
    placa='';
    interior='';
    bloque='';
}
  
function agregar(object,origen){
	document.guardarBeneficiario.dirDescriptiva.value="";
    document.guardarBeneficiario.dirDescriptiva.disabled = true;
    if(document.guardarBeneficiario.viaTipo.value==0){
    	alert('El tipo no es valido.');
    	return;
    }
    
    if(origen == 'tipo'){
    	tipo = object.value.toUpperCase();
    }
    if(origen == 'vNro'){
    	vNro = object.value.toUpperCase();
    }
    if(origen == 'vOr'){
    	vOr = object.value.toUpperCase();
    }
    if(origen == 'vApn'){
    	vApn = object.value.toUpperCase();
    }
    if(origen == 'cOr'){
    	cOr = object.value.toUpperCase();
    }
    if(origen == 'cNro'){
    	cNro = object.value.toUpperCase();
    }
    if(origen == 'cApn') {
    	cApn = object.value.toUpperCase();
    }
    if(origen == 'placa'){
    	placa = object.value.toUpperCase();
    }
    if(origen == 'interior'){
    	interior = object.value.toUpperCase();
    }
    if(origen == 'bloque'){
    	bloque = object.value;
    }
        
    //document.guardarBeneficiario.dirEncasillada.value = direccion;
    direccion = "";
    if(tipo != null && tipo != '0')
    	direccion += tipo+" ";
    if(vOr != null && vOr != "" && vOr != '0')
    	direccion += vOr;
    if(vNro != null && vNro != "" && vNro != '0')
    	direccion += vNro+" ";
    if(vApn != null && vApn != "" && vApn != '0')
    	direccion += vApn+"   ";
    if(cOr != null && cOr != "" && cOr != '0')
    	direccion += cOr+" ";
    if(cNro != null && cNro != "" && cNro != '0')
    	direccion += cNro;
    if(cApn != null && cApn != "" && cApn != '0')
    	direccion += cApn;
    if(placa != null && placa != "" && placa != '0')
    	direccion += "-"+placa+" ";
    if(bloque != null && bloque != "" && bloque != '0')
    	direccion += bloque;
    if(interior != null && interior != "" && interior != '0')
    	direccion += "("+interior+")";
    
    document.guardarBeneficiario.dirEncasillada.value =  direccion;
 }
</script>


<table style="width: 100%; border: 0; padding: 0; border-spacing: 0;">

	<tr align="left">
		<td height="25" colspan="12" align="center" class="titulosenblanco">
			<p>
				<STRONG>Ingresar Beneficiario</STRONG>
			</p>
			<p>&nbsp;</p>
		</td>
	</tr>


	<html:form action="/beneficiarios/GuardarBeneficiario.do" method="post"
		type="co.gov.medellin.ssti.sub.web.form.IngresarBeneficiarioForm"
		focus="tipoDocumento" styleId="mainForm">
		<tr align="left">
			<td height="25" colspan="12" class="titulosenblanco">
				<table
					style="width: 100%; border: 0; padding: 3px; border-spacing: 3px;"
					class="titulosenrojo">
					<tr>
						<td colspan="4">
							<DIV align="left">
								<html:errors />
								<logic:present name="fail"><%=session.getAttribute("fail")%></logic:present>
								<% session.removeAttribute("fail"); %>
							</DIV> <logic:present scope="request" name="msg">
								<DIV align="center">
									<%=request.getAttribute("msg")%>
								</DIV>
							</logic:present> <logic:present scope="request" name="msgNBene">
								<DIV align="center" class="celdatabla">
									<strong><%=request.getAttribute("msgNBene")%></strong>
								</DIV>
							</logic:present>
						</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Tipo
								Documento</strong> (*)&nbsp;&nbsp;</td>
						<td width="46%">
							<% String tipoDocumento = (String)request.getAttribute("tipoDocumento");
                     if((Object)tipoDocumento == null) tipoDocumento = request.getParameter("tipoDocumento");
                  %> <html:select property="tipoDocumento"
								styleClass="form" value="<%=tipoDocumento%>">
								<html:option value="C">C&eacute;dula de ciudadania</html:option>
								<html:option value="E">C&eacute;dula de extranjeria</html:option>
								<html:option value="N">Nit</html:option>
								<html:option value="P">Pasaporte</html:option>
								<html:option value="R">Registro civil</html:option>
								<html:option value="T">Tarjeta de identidad</html:option>
								<html:option value="I">NIP</html:option>
								<html:option value="U">NUIP</html:option>
								<html:option value="S">NISE</html:option>
								<html:option value="A">Cabildo</html:option>
								<html:option value="O">Otro</html:option>
							</html:select>
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Numero
								Documento</strong> (*)&nbsp;&nbsp;</td>
						<td width="46%">
							<% String numeroDocumento = (String)request.getAttribute("numeroDocumento");
               if((Object)numeroDocumento == null) numeroDocumento = request.getParameter("numeroDocumento");
            %> <html:text property="numeroDocumento" size="15"
								styleClass="form" value="<%=numeroDocumento%>" />
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla">
							<strong>Primer Nombre </strong>(*)
						</td>
						<td width="46%">
							<% String nombre1 = (String)request.getAttribute("nombre1");
				               if((Object)nombre1 == null) nombre1 = request.getParameter("primer_nombre");
				               if(nombre1.equals("null")) nombre1 ="";
            				%> 
           					<html:text property="primer_nombre" size="15"
								styleClass="form" value="<%=nombre1%>" /> &nbsp;&nbsp;
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla">
							<strong>Segundo Nombre</strong>
						</td>
						<td width="46%">
							<% String nombre2 = (String)request.getAttribute("nombre2");
				               if((Object)nombre2 == null) 
				                  nombre2 = request.getParameter("segundo_nombre");
				               if(nombre2.equals("null")) 
				                  nombre2 = "";
            				%> 
            				<html:text property="segundo_nombre" size="15"
								styleClass="form" value="<%=nombre2%>" />
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla">
							<strong>Primer Apellido</strong> (*)
						</td>
						<td width="46%">
							<% String apellido1 = (String)request.getAttribute("apellido1");
				               if((Object)apellido1 == null) apellido1 = request.getParameter("primerApellido");
				               if(apellido1.equals("null")) apellido1 ="";
            				%> 
            				<html:text property="primerApellido" size="15"
								styleClass="form" value="<%=apellido1%>" /> &nbsp;&nbsp;
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla">
							<strong>Segundo	Apellido</strong>
						</td>
						<td width="46%">
							<% String apellido2 = (String)request.getAttribute("apellido2");
				               if((Object)apellido2 == null) apellido2 = request.getParameter("segundoApellido");
				               if(apellido2.equals("null")) apellido2 ="";
            				%> 
            				<html:text property="segundoApellido" size="15"
								styleClass="form" value="<%=apellido2%>" />
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla">
							<strong>Fecha Nacimiento</strong> (dd/mm/aaaa)&nbsp;&nbsp;</td>
						<td width="46%">
							<% String fechaNacimiento = (request.getParameter("fechaNacimiento") == null) ? "" : request.getParameter("fechaNacimiento"); %>
							<input name="fechaNacimiento" id="fechaNacimiento" class="form" value="<%= fechaNacimiento %>" />
							<P align="center">								
								<input type="hidden" name="fecha" id="fecha"/>
							</P>
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Sexo</strong></td>
						<td width="46%">
							<% String sexo = (String)request.getAttribute("sexo");
              					if((Object)sexo == null) sexo = request.getParameter("sexo");   
           					%> 
           					<html:select property="sexo" styleClass="form"
								value="<%= sexo %>">
								<html:option value="M">Masculino</html:option>
								<html:option value="F">Femenino</html:option>
							</html:select>
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<% String telefono = (String)request.getAttribute("telefono");
              				if((Object)telefono == null) telefono = request.getParameter("telefono");   
            			%>
						<td width="23%" class="celdatabla">
							<strong>Tel&eacute;fono</strong>
						</td>
						<td width="46%">
							<html:text property="telefono"
								value="<%=telefono%>" size="15" styleClass="form" />
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td colspan="3" class="celdatabla">
							<DIV align="left">
								<P>
									<strong>Direccion Encasillada</strong>
								</P>
							</DIV>
						</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td colspan="3" class="celdatabla">
							<div align="left">
								<table
									style="width: 48%; border: 1; padding: 2px; border-spacing: 3px;">
									<tr>
										<td colspan="4">
											<DIV align="center">
												<STRONG>Datos de la via</STRONG>
											</DIV>
										</td>
										<td colspan="3">
											<DIV align="center">
												<STRONG>Datos del cruce</STRONG>
											</DIV>
										</td>
										<td colspan="3">
											<DIV align="center">
												<STRONG>Datos adicionales</STRONG>
											</DIV>
										</td>
									</tr>
									<tr>
										<td>
											<DIV align="center">Tipo</DIV>
										</td>
										<td>
											<DIV align="center">Or.</DIV>
										</td>
										<td>
											<DIV align="center">Nro.</DIV>
										</td>
										<td>
											<DIV align="center">Apn.</DIV>
										</td>
										<td>
											<DIV align="center">Or.</DIV>
										</td>
										<td>
											<DIV align="center">Nro.</DIV>
										</td>
										<td>
											<DIV align="center">Apn.</DIV>
										</td>
										<td>
											<DIV align="center">Placa</DIV>
										</td>
										<td>
											<DIV align="center">Bloque</DIV>
										</td>
										<td>
											<DIV align="center">Interior</DIV>
										</td>

									</tr>
									<tr>
										<td>
											<% String tipo = request.getParameter("viaTipo"); %> 
											<select size="1" name="viaTipo" id="viaTipo" onchange="agregar(this,'tipo')"
												onmouseover="this.T_WIDTH=180;this.T_TITLE='Tipo de via';return escape('Corresponde al tipo de via.');"
												class="form">
												<% if((Object)tipo != null){
                            						if(tipo.equals("0")){
                            					%>
												<option value="0" selected="selected"></option>
												<%}else{%>
												<option value="0"></option>
												<%}%>
												<% if(tipo.equals("CR")){%>
												<option value="CR" selected="selected">Carrera</option>
												<%}else{%>
												<option value="CR">Carrera</option>
												<%}%>
												<% if(tipo.equals("CL")){%>
												<option value="CL" selected="selected">Calle</option>
												<%}else{%>
												<option value="CL">Calle</option>
												<%}%>
												<% if(tipo.equals("CQ")){%>
												<option value="CQ" selected="selected">Circular</option>
												<%}else{%>
												<option value="CQ">Circular</option>
												<%}%>
												<% if(tipo.equals("TR")){%>
												<option value="TR" selected="selected">Transversal</option>
												<%}else{%>
												<option value="TR">Transversal</option>
												<%}%>
												<% if(tipo.equals("DG")){%>
												<option value="DG" selected="selected">Diagonal</option>
												<%}else{%>
												<option value="DG">Diagonal</option>
												<%}%>
												<% if(tipo.equals("AV")){%>
												<option value="AV" selected="selected">Avenida</option>
												<%}else{%>
												<option value="AV">Avenida</option>
												<%}
                          						}else{%>
												<option value="0"></option>
												<option value="CR">Carrera</option>
												<option value="CL">Calle</option>
												<option value="CQ">Circular</option>
												<option value="TR">Transversal</option>
												<option value="DG">Diagonal</option>
												<option value="AV">Avenida</option>
												<%}%>
										</select>
										</td>
										<td>
											<% String vOr = request.getParameter("viaOrientacion"); %> <select
											size="1" class="form" onchange="agregar(this,'vOr')"
											name="viaOrientacion" id="viaOrientacion"
											onmouseover="this.T_WIDTH=180;this.T_TITLE='Orientacion de la via';return escape('Corresponde a la orientacion de la via.');">
												<% if((Object)vOr != null){
                            					if(vOr.equals("0")){%>
												<option value="0" selected="selected"></option>
												<%}else{%>
												<option value="0"></option>
												<%}%>
												<% if(vOr.equals("E")){%>
												<option value="E" selected="selected">Este</option>
												<%}else{%>
												<option value="E">Este</option>
												<%}%>
												<% if(vOr.equals("S")){%>
												<option value="S" selected="selected">Sur</option>
												<%}else{%>
												<option value="S">Sur</option>
												<%}
                    							}else{%>
												<option value="0"></option>
												<option value="E">Este</option>
												<option value="S">Sur</option>
												<%}%>
										</select>
										</td>
										<td>
											<% String vNro = request.getParameter("vNro"); 
                      							if((Object)vNro == null) vNro = "";
                   							%> 
                   							<input type="text" value="<%=vNro%>"
												onchange="agregar(this,'vNro')" name="vNro" id="vNro" class="form"
												maxlength="3" size="3"
												onmouseover="this.T_WIDTH=180;this.T_TITLE='Numero de la via';return escape('Corresponde al numero de la via.');" />
										</td>
										<td>
											<% String vAp = request.getParameter("viaApendice"); 
                      							if((Object)vAp == null) vAp = "";
                   							%> 
                   							<input type="text" value="<%=vAp%>" class="form"
												size="2" maxlength="2" name="viaApendice" id="viaApendice"
												onchange="agregar(this,'vApn')"
												onmouseover="this.T_WIDTH=180;this.T_TITLE='Apendice de la via';return escape('Corresponde al apendice; ejemplo: A, AA, B, BB etc.');" />
										</td>
										<td>
											<DIV align="center">
												<% String cOr = request.getParameter("cruceOrientacion"); %>
												<select size="1" class="form" name="cruceOrientacion" id="cruceOrientacion"
													onchange="agregar(this,'cOr')"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Orientacion del cruce';return escape('Corresponde a la orientacion del cruce.');">
													<% if((Object)cOr != null){
                            						if(cOr.equals("0")){%>
													<option value="0" selected="selected"></option>
													<%}else{%>
													<option value="0"></option>
													<%}%>
													<% if(cOr.equals("E")){%>
													<option value="E" selected="selected">Este</option>
													<%}else{%>
													<option value="E">Este</option>
													<%}%>
													<% if(cOr.equals("S")){%>
													<option value="S" selected="selected">Sur</option>
													<%}else{%>
													<option value="S">Sur</option>
													<%}
                    								}else{%>
													<option value="0"></option>
													<option value="E">Este</option>
													<option value="S">Sur</option>
													<%}%>
												</select>
											</DIV>
										</td>
										<td>
											<DIV align="center">
												<% String cNro = request.getParameter("cruceNumero"); 
                      							if((Object)cNro == null) cNro = "";
                      							%>
												<input type="text" value="<%=cNro%>" class="form" size="3"
													maxlength="3" name="cruceNumero" id="cruceNumero"
													onchange="agregar(this,'cNro')"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Numero del cruce';return escape('Primer numero de la placa de la puerta.');" />
											</DIV>
										</td>
										<td>
											<DIV align="center">
												<% String cAp = request.getParameter("cruceApendice"); 
                      							if((Object)cAp == null) cAp = "";
                    							%>
												<input type="text" value="<%=cAp%>" class="form"
													maxlength="2" size="2" name="cruceApendice" id="cruceApendice"
													onchange="agregar(this,'cApn')"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Apendice del cruce';return escape('Corresponde al apendice; ejemplo: A, AA, B, BB etc.');" />
											</DIV>
										</td>
										<td>
											<DIV align="center">
												<% String placa = request.getParameter("placa"); 
                      							if((Object)placa == null) placa = "";
                    							%>
												<input type="text" value="<%=placa%>" size="3" maxlength="3"
													name="placa" id="placa" onchange="agregar(this,'placa')" class="form"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Placa';return escape('Es el segundo numero de la puerta y que corresponde a la distancia que existe entre la esquina y la propiedad.');" />
											</DIV>
										</td>
										<td>
											<DIV align="center">
												<% String bloque = request.getParameter("bloque"); 
                      							if((Object)bloque == null) bloque = "";
                    							%>
												<input type="text" value="<%=bloque%>" class="form"
													maxlength="2" name="bloque" id="bloque"
													onchange="agregar(this,'bloque')" size="2"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Bloque';return escape('Aplica para edificios o unidades residenciales.');" />
											</DIV>
										</td>
										<td>
											<DIV align="center">
												<% String interior = request.getParameter("interior"); 
                      							if((Object)interior == null) interior = "";
                     							%>
												<input type="text" value="<%=interior%>" class="form"
													size="5" name="interior" id="interior"
													onchange="agregar(this,'interior')" maxlength="5"
													onmouseover="this.T_WIDTH=180;this.T_TITLE='Interior';return escape('El numero de apartamento, si es el caso.');" />
											</DIV>
										</td>

									</tr>
									<tr>
										<td colspan="10">
											<DIV align="center">
												<STRONG>Direccion Generada </STRONG>
											</DIV>
										</td>
									</tr>
									<tr>
										<% String dire = request.getParameter("dirEncasillada"); 
                      					if((Object)dire == null) dire = "";
                     					%>
										<td colspan="10">
											<DIV align="center">
												<html:text property="dirEncasillada" styleId="dirEncasillada" size="40"
													value="<%=dire%>" styleClass="form" readonly="true" />
												<input type="button" value="Limpiar" onclick="LimpiarEnc()" />
											</DIV>
										</td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
					<%
              String ML = (String)request.getAttribute("ML");
              if(ML == null) 
                ML = request.getParameter("ML");
              if(ML != null && ML.equals("true"))
              {
                String direccion = request.getParameter("direccion");
                if(ML == null || ML.equals("null")) 
                  direccion = (String)request.getAttribute("direccion");
                if(ML != null)
                {
            	%>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Direccion
								en Matricula en Linea</strong></td>
						<td width="46%"><input type="text" class="form"
							readonly="readonly" name="direccion" value="<%=direccion%>"
							size="40" /> <input type="hidden" name="ML" value="true" /></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<%  }
              	}else{
            	%>
					<input type="hidden" name="ML" value="false" />
					<%}%>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Direccion
								Descriptiva</strong></td>
						<td width="46%">
							<html:text property="dirDescriptiva" styleId="dirDescriptiva" size="40" styleClass="form" />
						</td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Barrio/Vereda</strong>
						</td>
						<td width="46%"><html:select styleId="barrios"
								property="codeBarrio" styleClass="form"
								onchange="buscar('barrio')">
								<html:option value="">Seleccione un barrio</html:option>
								<logic:present name="barrios">
									<html:options name="barrios" labelName="code"
										labelProperty="descVflex" property="code" collection="barrios" />
								</logic:present>
							</html:select></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Comuna</strong>(*)
							<input type="hidden" name="opcion" value="" /></td>
						<td width="46%"><html:select styleId="comunas"
								property="vflComuna" styleClass="form">
								<html:option value="">Seleccione una comuna</html:option>
								<html:options name="comunas" labelName="code"
									labelProperty="descVflex" property="code" collection="comunas" />
							</html:select></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Zona</strong></td>
						<td width="46%"><html:select styleId="zonas"
								property="codeZona" styleClass="form">
								<html:option value="">Seleccione una zona</html:option>
								<html:options name="zonas" labelName="code"
									labelProperty="descVflex" property="code" collection="zonas" />
							</html:select></td>
						<td width="3%">&nbsp;</td>
					</tr>


					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Cobama</strong></td>
						<td width="46%"><html:text property="cobama" size="8"
								maxlength="7" styleClass="form" /></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Etnia</strong></td>
						<td width="46%"><html:select property="etnia"
								styleClass="form">
								<html:option value="O">Otra</html:option>
								<html:option value="A">Afrocolombiano</html:option>
								<html:option value="I">Indigena</html:option>
							</html:select></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>E-mail</strong></td>
						<td width="46%"><html:text property="mail" size="20"
								styleClass="form" /></td>
						<td width="3%">&nbsp;</td>
					</tr>
					<tr>
						<td width="28%">&nbsp;</td>
						<td width="23%" class="celdatabla"><strong>Hecho victimizante</strong></td>
						<td width="46%">
							<html:select styleId="hechosVictimizantes"
								property="codeHechoVictimizante" styleClass="formInputOutput">
								<html:option value="">Seleccione..</html:option>
								<html:options name="hechosVictimizantes" labelName="code"
									labelProperty="descVflex" property="code" collection="hechosVictimizantes" />
							</html:select>
						</td>
						<td width="3%">&nbsp;</td>
						</tr>
					<tr>
						<td colspan="4">
							<DIV align="center">
								<input type="button" id="guardarBtn" value="Guardar" onClick="validar()" />
							</DIV>

						</td>
					</tr>
				</table>
			</td>
		</tr>
		<script type="text/javascript">

  var tipo = document.guardarBeneficiario.viaTipo.value;
  var vNro = document.guardarBeneficiario.vNro.value;
  var vOr = document.guardarBeneficiario.viaOrientacion.value;
  var vApn = document.guardarBeneficiario.viaApendice.value;
  var cOr = document.guardarBeneficiario.cruceOrientacion.value;
  var cNro = document.guardarBeneficiario.cruceNumero.value;
  var cApn = document.guardarBeneficiario.cruceApendice.value;
  var placa = document.guardarBeneficiario.placa.value;
  var interior = document.guardarBeneficiario.interior.value;
  var bloque = document.guardarBeneficiario.bloque.value;
  /*if(document.guardarBeneficiario.opcion.value == "")
  {
    tipo = '0';
    vNro = '000';
    vOr = '0';
    vApn = '00';
    cOr = '0';
    cNro = '000';
    cApn = '00';
    placa = '000';
    interior = '00000';
    bloque = '00';
  }*/
</script>
	</html:form>
</table>
